import Component from "../../../component";
import { getStaticData } from "../../../../service/data";

export class BorderBox2 extends Component {
  config = {
    content: "dv-border-box-2",
    textStyle: {
      fontFamily: "Microsoft Yahei",
      fontSize: 24,
      color: "#fff",
      fontWeight: "normal",
      textAlign: "text",
      letterSpacing: 0,
    },
    backgroundStyle: {
      show: false,
      bgColor: "#008bff",
    },
    urlConfig: {
      url: "",
      isBlank: false
    }
  };
  apis = null;
  apiData = null;
  events = null;
  actions = null;

  constructor(obj) {
    super("DvBorderBox2", { w: 300, h: 300 },);
    this.initData();
  }

  initData() {
    this.apis = {};
    this.apiData = {};
    this.events = {};
    this.actions = {};
    return this;
  }

  async loadData() {
    try {
      const path = "";
      const res = await getStaticData(this.id, path);
      this.apiData.source.config.data = JSON.stringify(res.data);
    } catch (error) {
      throw error;
    }
  }
}
